package com.hejr.controller;

import com.hejr.common.CommonResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: User控制层
* @author:hejr
* @date:2019/4/9
*/
@RestController
public class UserController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Autowired
    private RedisTemplate redisTemplate;


    /**
     * 新增用户
     *
     * @param userName
     * @return
     */
    @RequestMapping("/addUser")
    public Object addUser(String userName) {
        CommonResultObject resultObject = new CommonResultObject();
        try {
            resultObject.setResult(null);
            resultObject.setCode(200);
            resultObject.setMessage("新增用户成功.....");
        } catch (Exception e) {
            resultObject.setCode(1);
            resultObject.setMessage("新增用户失败.....");
            e.printStackTrace();
        }
        return resultObject;
    }

}